/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2021年5月26日
 */
package com.massyframework.beanskin.runtime.framework;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 缺省的运行框架配置器
 * @author huangkh
 *
 */
class AttributeConfig extends InitParamConfig{

	private Map<String, Object> attributeMap;
	
	/**
	 * 
	 */
	public AttributeConfig() {
		this.attributeMap = new ConcurrentHashMap<>();
	}

	/**
	 * 根据{@code name}获取对应属性值
	 * @param name {@link String},属性名
	 * @return {@link Object},属性值，可能返回null.
	 */
	public Object getAttribute(String name) {
		if (name == null) return null;
		return this.attributeMap.get(name);
	}

	/**
	 * 设置属性
	 * @param name {@link String},属性名
	 * @param value {@link Object},属性值
	 */
	public void setAttribute(String name, Object value) {
		this.attributeMap.put(name, value);
	}
}
